//
//  QDUnionFillFooterView.swift
//  QDMetroClient
//
//  Created by YueWen on 2019/3/6.
//  Copyright © 2019 YueWen. All rights reserved.
//

import UIKit

/// 放置下一步的fooerView
final class QDUnionFillFooterView: UIView {

    /// 渐变色
    private let gradLayer = CAGradientLayer()
    /// 下一步按钮
    let nextButton = UIButton()
    
    override init(frame: CGRect) {
        super.init(frame: frame)
        
//        gradLayer.colors = [QDColors.theme.cgColor,#colorLiteral(red: 0.4509803922, green: 0.8705882353, blue: 0.5215686275, alpha: 1).cgColor]
        gradLayer.colors = [#colorLiteral(red: 0.4509803922, green: 0.8705882353, blue: 0.5215686275, alpha: 1).cgColor,QDColors.theme.cgColor]
        gradLayer.position = .zero
        gradLayer.anchorPoint = .zero
        gradLayer.bounds = CGRect(origin: .zero, size: CGSize(width: UIScreen.main.ritl_width - 40, height: 44))
        
        nextButton.setTitle("去签约", for: .normal)
        nextButton.setTitleColor(.white, for: .normal)
        nextButton.titleLabel?.font = Font.medium.font(size: 16)
        nextButton.layer.cornerRadius = 22
        nextButton.clipsToBounds = true
        nextButton.layer.insertSublayer(gradLayer, at: 0)
        
        addSubview(nextButton)
        
        nextButton.snp.makeConstraints { (make) in
            make.top.equalToSuperview().offset(25)
            make.left.equalToSuperview().offset(20)
            make.right.equalToSuperview().inset(20).priority(.high)
            make.height.equalTo(44)
        }
    }
    
    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
}
